package com.scrx.ymg.action;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.google.gson.Gson;
import com.scrx.ymg.entity.UserComplain;
import com.scrx.ymg.service.agent.IAgentService;

@Controller
@RequestMapping("/complaintAction")
public class ComplaintAction {
    
	@Autowired
	private IAgentService agents;

	/**
	 * 代理商查询超市投诉
	 * 
	 * @param agentId
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getUserComplaint", produces = "text/json;charset=UTF-8")
	public String getUserComplaint(UserComplain complain,String startTime,String endTime, int pageNum, int pageCount) {
		Map<Object, Object> map = agents.getUserComplaint(complain, startTime, endTime, pageNum, pageCount);
		Gson gson = new Gson();
		return gson.toJson(map);
	}

}
